﻿using System;

namespace Crap4Net.CCParsers
{
    public class CCParserFactory
    {
        public const string REFLECTOR_TOOL_NAME = "Reflector";
        public const string CODEMETRICS_TOOL_NAME = "CodeMetric";
        public const string NCOVER3_TOOL_NAME = "NCover3";

        public static ICCParser CreateParser(string toolName)
        {
            switch (toolName)
            {
                case REFLECTOR_TOOL_NAME:
                    return new ReflectorParser();
                case CODEMETRICS_TOOL_NAME:
                    return new VSMetricsParser();
                case NCOVER3_TOOL_NAME:
                    return new NCover3CCParser();
                default:
                    throw new ArgumentException(String.Format("unsupported CC tool: {0}", toolName));
            }
   }
    }
}
